var app = new Vue({
    el: "#app",
    data: {
        city:'',
        weatherList: [],
    },
    methods: {
        searchWeather: function(){
            /* console.log("aaa");
            console.log(this.city); */
            //调用接口
            //因为是回调函数，所以要保存this
            var that = this;
            axios.get('http://wthrcdn.etouch.cn/weather_mini?city='
            +this.city)
            .then(function(response){
                //console.log(response);
                console.log(response.data.data.forecast);
                that.weatherList = response.data.data.forecast;
            })
            .catch(function(err){})
        },
        changeCityWeather: function(city){
            this.city = city;
            this.searchWeather();
        }
    }
})